﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StyleMVVM.View.Impl
{
	public sealed class ViewContext : IViewContext
	{
		private WeakReference viewReference;

		public ViewContext(object view)
		{
			if (view == null)
			{
				throw new ArgumentNullException("view");
			}

			viewReference = new WeakReference(view);
		}

		public object View
		{
			get { return viewReference.Target; }
		}
	}
}
